package com.th.atguigu.aopanno;

import com.th.atguigu.aopxml.Book;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author ThreePure
 * @date 2022/3/10 8:44
 * @description: TODO
 * @since 1.8
 */
public class MyTest {
    @Test
    public void testOne(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        User user = context.getBean("user", User.class);
        user.add();
    }

    @Test
    public void testTwo(){
        ApplicationContext context = new ClassPathXmlApplicationContext("beanXml.xml");
        Book book = context.getBean("book", Book.class);
        book.buy();
    }
}


